<?php
 include "template/header.php";
 
 if(isset($_SESSION['tipo_usuario'])){
 
		$id = $_SESSION['tipo_usuario'];
		
		if($id == '4' || $id == '6' ){
?>
<a href="inserir_medicamento.php"><button>Inserir</button></a>
<h2>Relação de Medicamentos</h2> 
<table cellspacing=0 border=0>
		<tr align="left" id="table_title">
			<th>Nome</th><th>Valor</th><th>Quantidade</th>
		</tr>
	<?php
		$sql = "select * from medicamentos";
		
		$rs = mysql_query($sql, $con);
		
		while($reg = mysql_fetch_array($rs)){		
	?>
		<tr align="left">
			<th width="200px"><?php echo $reg['nm_medicamento'] ?></th>
			<th width="200px"><?php echo $reg['valor'] ?></th>
			<th width="200px"><?php echo $reg['qtd'] ?></th>
		</tr>
	<?php
		}
	?>
	</table>
 
 
<?php 
	}
}
 include "template/footer.php";
?>